<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width='device-width', initial-scale=1.0">
  <title>Document</title>
  <!-- 引入react核心库 -->
  <script src="/node_modules/react/umd/react.development.js"></script>
  <!-- 引入react-dom 用于支持react操作dom -->
  <script src="/node_modules/react-dom/umd/react-dom.development.js"></script>
  <!-- jsx转换为浏览器可识别的代码 -->
  <script src="/node_modules/@babel/standalone/babel.min.js"></script>
</head>
<body>
  <div id="root"></div>
</body>
<script type="text/babel">
  // 创建React元素/创建虚拟dom-使用jsx语法
  let item = <div className='item'>
    <h2 className='title'>成绩单</h2>
    <ol className='list'>
      <li>小明</li>
      <li>大明</li>
      <li>二明</li>
    </ol>
  </div>
  // 创建根节点
  let root = ReactDOM.createRoot(document.getElementById('root'))
  // 把虚拟dom渲染到页面中
  root.render(item)
  console.log('虚拟dom',item)
  console.log('真实dom',document.getElementById('root'))
</script>
</html>